import ReactJsonView from 'react-json-view'
import styles from './index.module.less'
const ReactJson = ({ json, onChange }) => {
  return (
    <div className={styles['react-json-view-container']}>
      <ReactJsonView
        src={json}
        displayDataTypes={false}
        onAdd={({ updated_src }) => {
          onChange(updated_src)
        }}
        onEdit={({ updated_src }) => {
          onChange(updated_src)
        }}
        onDelete={({ updated_src }) => {
          onChange(updated_src)
        }}
      />
    </div>
  )
}
export default ReactJson
